﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace Pension.Utilities
{
    public class PopupHelper
    {
        #region " Show Popup Message "

        public void ShowMessage(Page Page, string message)
        {
            string strScript;
            strScript = "<script language=javascript>alert('" + message + "');</script>";
            Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "redir", strScript);
        }

        public void ShowMessageAndRedirect(Page Page, string message, string UrlToGoAfferMessage)
        {
            string strScript;
            //strScript = "<script language=javascript>alert('" + message + "');";
            strScript = "<script language=javascript>";
            strScript += "location.replace('" + UrlToGoAfferMessage + "')</script>";
            Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "redirM", strScript);
        }
        public void Redirect(Page Page, string UrlToGoAfferMessage)
        {
            string strScript;
            strScript = "";
            strScript += "location.replace('" + UrlToGoAfferMessage + "')</script>";
            Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "redirM", strScript);
        }
        #endregion

        #region " Message Suphachai"

        public static string ShowMessageAlert(string message)
        {
            string str = "alert('" + message + "');";
            return str;
        }

        #endregion
    }
}
